from django.contrib import admin
from .models import Document, Question

@admin.register(Document)
class DocumentAdmin(admin.ModelAdmin):
    list_display = ('id', 'title', 'file_type', 'upload_time', 'download_count')
    search_fields = ('title',)
    list_filter = ('file_type', 'upload_time')

@admin.register(Question)
class QuestionAdmin(admin.ModelAdmin):
    list_display = ('id', 'document', 'question_type', 'page_number', 'created_at')
    list_filter = ('question_type', 'document', 'page_number')
    search_fields = ('content', 'answer')
